package com.gdcn.zb.sys.dao.impl;

import java.util.List;

import com.gdcn.zb.base.BaseDao;
import com.gdcn.zb.base.exception.DaoException;
import com.gdcn.zb.sys.dao.ITypeFunctionDao;
import com.gdcn.zb.sys.valueobject.TypeFunction;

public class TypeFunctionDaoHibernate extends BaseDao implements ITypeFunctionDao {

	@Override
	protected Class getModelClass() {
		return TypeFunction.class;
	}

	public TypeFunction findTypeFunctionById(int id) throws DaoException {
		return (TypeFunction)super.doFindObjectById(id);
	}

	public List listTypeFunctionOfAll() throws DaoException {
		return doListAllObject();
	}

	public List listTypes(String parentcode) throws DaoException {
		return super.doFind("from "+this.getModelClass().getName()+" type where type.parent.code='"+parentcode+"'");
	}

}
